using MvvmFx.Samples.HowTos.CommandHandlers.ViewModels;
using MvvmFx.Samples.HowTos.PropertyHandlers.ViewModels;
using MvvmFx.Samples.HowTos.Validation.ViewModel;
using MvvmFx.Samples.HowTos.ViewModelHelper.ViewModels;

namespace MvvmFx.Samples.HowTos
{
    /// <summary>
    /// Static Factory class to build the HowTos
    /// </summary>
    public static class HowTosBuilder
    {
        /// <summary>
        /// Build the collection of How To.. examples
        /// </summary>
        public static void Build()
        {
            // Property Change
            //
            var propertyHandlers = new PropertyHandlersViewModel { Key = "Handle Property Changes" };
            ApplicationViewModel.Instance.HowTos.Add(propertyHandlers);

            // Validation 
            //
            var deliveryVM = new DeliveryViewModel { Key = "Use Validation Rules" };
            ApplicationViewModel.Instance.HowTos.Add(deliveryVM);

            // ViewModel Helper
            //
            var viewModelHelperVM = new ViewModelHelperViewModel
                                        {
                                            Key = "Enhance MVVM Support"
                                        };
            ApplicationViewModel.Instance.HowTos.Add(viewModelHelperVM);

            // Command Handlers
            //
            var commandHandlersVM = new CommandHandlersSampleViewModel { Key = "Use Command Handlers" };
            ApplicationViewModel.Instance.HowTos.Add(commandHandlersVM);

            //var contactDetails = _container.Resolve<ContactDetailsViewModel>();
            //contactDetails.Key = "Track changes in child objects";
            //contactDetails.Load();
            //_howTos.Add(contactDetails);

            //var boolVM = new BoolViewModel { Key = "Bind to Commands" };
            //_howTos.Add(boolVM);
        }
    }
}